Refactor polyglot validation sample layout#15650
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15650Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15650" |
There was a problem hiding this comment.
Pull request overview
Refactors the polyglot validation samples into a shared tests/Polyglot/<Language> layout and updates CI validation scripts to validate per-language AppHosts via aspire restore --apphost.
Changes:
- Moves validation inputs from
playground/polyglot/**intotests/Polyglot/**(per-language roots; one AppHost file per integration). - Updates TypeScript/Python/Java CI validation scripts to enumerate
*.apphost.*files and restore/typecheck/compile each one. - Adjusts Java validation compilation to copy suffixed AppHost filenames into a temporary
AppHost.javabeforejavac.
Reviewed changes
Copilot reviewed 256 out of 595 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/polyglot-validation/test-typescript-playground.sh |
Switches validation to tests/Polyglot/TypeScript, restores per AppHost, and type-checks via a generated temporary tsconfig. |
.github/workflows/polyglot-validation/test-python-playground.sh |
Switches validation to tests/Polyglot/Python, restores per AppHost, and byte-compiles the selected AppHost plus generated modules. |
.github/workflows/polyglot-validation/test-java-playground.sh |
Switches validation to tests/Polyglot/Java, restores per AppHost, and compiles by copying the selected AppHost into a temporary AppHost.java. |
playground/polyglot/** |
Removes legacy per-sample configs/run settings now superseded by the shared tests/Polyglot/<Language> layout. |
Files not reviewed (17)
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppService/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.Functions/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.PostgreSQL/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.Search/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/package-lock.json: Language not supported
- playground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/package-lock.json: Language not supported
.github/workflows/polyglot-validation/test-typescript-playground.sh
Outdated
Show resolved
Hide resolved
.github/workflows/polyglot-validation/test-typescript-playground.sh
Outdated
Show resolved
Hide resolved
.github/workflows/polyglot-validation/test-typescript-playground.sh
Outdated
Show resolved
Hide resolved
.github/workflows/polyglot-validation/test-typescript-playground.sh
Outdated
Show resolved
Hide resolved
.github/workflows/polyglot-validation/test-typescript-playground.sh
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23662411671 |
| @@ -28,14 +28,14 @@ internal sealed class DefaultLanguageDiscovery(IFeatures features) : ILanguageDi | |||
| LanguageId: new LanguageId("typescript/nodejs"), | |||
| DisplayName: "TypeScript (Node.js)", | |||
| PackageName: "Aspire.Hosting.CodeGeneration.TypeScript", | |||
| DetectionPatterns: ["apphost.ts"], | |||
| DetectionPatterns: ["apphost.ts", "*.apphost.ts"], | |||
There was a problem hiding this comment.
Not doing that means that we would require a single apphost.ts per folder, and no other name can be used. In this PR instead of having all apphosts in the same language-specific folder, we need a new folder per apphost, and they will only have that one file. Though we would also have a dedicated aspire.settings.json with a single package ref too.
There was a problem hiding this comment.
An alternate structure if we can only have apphost.EXT as the apphost filename would be to have one folder per integration, and all languages there, sharing the same config.
tests/Polyglot/Aspire.Hosting.Redis
- apphost.ts
- apphost.py
- AppHost.java
- aspire.config.json
This could create conflicts though if the languages generate the same files or folders
There was a problem hiding this comment.
This is better and only for our repo.
Description
Refactors the TypeScript, Python, and Java polyglot validation samples into shared per-language roots under
tests/Polyglot, with one AppHost file per integration.This also updates the Aspire CLI polyglot AppHost detection so suffixed filenames like
aspire.hosting.sqlserver.apphost.tsare recognized, and adjusts the Java runtime/validation flow to compile renamed AppHosts through a temporaryAppHost.java.The CI validation scripts now target the new
tests/Polyglot/<Language>layout and restore each sample with--apphostagainst a sharedaspire.config.jsonper language.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: